#ifndef GET_ODOM_H
#define GET_ODOM_H

#include<ros/ros.h>
#include<ros/package.h>
#include<nav_msgs/Odometry.h>
#include<geometry_msgs/PoseStamped.h>
#include<nlohmann/json.hpp>
#include<string>
#include<fstream>

using json = nlohmann::json;
namespace obstacle_avoid
{
    class odomConverter
    {
    private:  

        //data
        std::vector<std::string> topic;
        json config_;
        nav_msgs::Odometry odom;
        geometry_msgs::PoseStamped pose;
        std::string pub_topic;
        std::string sub_topic;
        
        //ROS utils
        ros::NodeHandle node;
        ros::Subscriber topic_sub;
        ros::Publisher topic_pub;

        //ROS Function
        void odomCallback(const nav_msgs::OdometryConstPtr &msg);
        void poseCallback(const geometry_msgs::PoseStampedConstPtr &msg);

    public:
        void init(ros::NodeHandle &nh ,std::string &type);
        void run(std::string &type);
    };  
}// namespace obstacle_avoid

#endif